# A plotting R script produced by the REVIGO server at http://revigo.irb.hr/ # If you found REVIGO useful in your work, please cite the following reference: # Supek F et al. "REVIGO summarizes and visualizes long lists of Gene Ontology # terms" PLoS ONE 2011. doi:10.1371/journal.pone.0021800 # -------------------------------------------------------------------------- # If you don't have the ggplot2 package installed, uncomment the following line: # install.packages ("ggplot2"); library (ggplot2); # -------------------------------------------------------------------------- # Here is your data from REVIGO. Scroll down for plot configuration options. revigo.names <- c("term_ID","description","frequency_%","plot_X","plot_Y","plot_size","log10_p_value","uniqueness","dispensability"); revigo.data <- rbind(c("GO:0000302","response to reactive oxygen species", 0.096,-6.135,-0.902, 4.039,-2.3686,0.919,0.000), c("GO:0006800","oxygen and reactive oxygen species metabolic process", 0.154, 2.423,-4.831, 4.210,-1.4235,0.982,0.000), c("GO:0015992","proton transport", 1.025,-4.404,-5.731, 5.067,-1.2620,0.926,0.000), c("GO:0021700","developmental maturation", 0.029, 7.426, 0.060, 3.520,-1.7308,0.859,0.000), c("GO:0032970","regulation of actin filament-based process", 0.032, 3.590,-7.018, 3.558,-2.8191,0.743,0.000), c("GO:0046165","alcohol biosynthetic process", 0.378,-2.241, 6.339, 4.634,-2.6175,0.735,0.000), c("GO:0016052","carbohydrate catabolic process", 1.399,-4.640, 3.807, 5.203,-2.1797,0.820,0.011), c("GO:0007010","cytoskeleton organization", 0.203,-2.494,-6.084, 4.363,-2.7493,0.721,0.017), c("GO:0030029","actin filament-based process", 0.106, 2.252, 4.698, 4.084,-1.2847,0.954,0.019), c("GO:0015980","energy derivation by oxidation of organic compounds", 4.971,-3.289,-0.775, 5.753,-1.6023,0.882,0.027), c("GO:0007017","microtubule-based process", 0.308, 1.956,-2.519, 4.546,-1.0912,0.952,0.028), c("GO:0042743","hydrogen peroxide metabolic process", 0.046, 1.038, 2.597, 3.718,-1.4546,0.940,0.046), c("GO:0006457","protein folding", 0.973, 1.657,-0.240, 5.045,-1.7105,0.918,0.069), c("GO:0006732","coenzyme metabolic process", 2.448,-0.695,-1.996, 5.445,-1.2930,0.922,0.073), c("GO:0051186","cofactor metabolic process", 3.543,-0.817, 0.140, 5.606,-1.2134,0.919,0.077), c("GO:0006091","generation of precursor metabolites and energy", 6.142, 0.156,-4.185, 5.845,-2.7174,0.915,0.085), c("GO:0044271","cellular nitrogen compound biosynthetic process", 7.935,-3.283, 5.067, 5.956,-1.0702,0.838,0.198), c("GO:0043523","regulation of neuron apoptotic process", 0.017, 2.601,-6.946, 3.294,-1.1666,0.854,0.202), c("GO:0006090","pyruvate metabolic process", 0.041, 0.595, 6.470, 3.667,-2.3043,0.838,0.208), c("GO:0045454","cell redox homeostasis", 0.541, 2.828,-7.202, 4.790,-1.7405,0.754,0.254), c("GO:0009152","purine ribonucleotide biosynthetic process", 1.244,-2.349, 4.950, 5.151,-2.2353,0.640,0.280), c("GO:0043085","positive regulation of catalytic activity", 0.277, 3.744,-7.197, 4.499,-1.1364,0.836,0.295), c("GO:0006818","hydrogen transport", 1.025,-4.466,-5.276, 5.067,-1.0878,0.957,0.299), c("GO:0009628","response to abiotic stimulus", 0.404,-5.497, 0.206, 4.664,-1.0911,0.953,0.317), c("GO:0043242","negative regulation of protein complex disassembly", 0.014, 0.933,-7.398, 3.218,-2.6504,0.695,0.423), c("GO:0044087","regulation of cellular component biogenesis", 0.077, 1.297,-7.057, 3.943,-1.9938,0.769,0.428), c("GO:0060284","regulation of cell development", 0.049, 6.493,-1.890, 3.749,-1.7226,0.716,0.497), c("GO:0001763","morphogenesis of a branching structure", 0.026, 7.085, 0.387, 3.470,-1.4285,0.844,0.523), c("GO:0008544","epidermis development", 0.032, 7.568, 0.459, 3.564,-1.4285,0.821,0.530), c("GO:0003006","developmental process involved in reproduction", 0.141, 6.988, 1.791, 4.207,-1.3843,0.830,0.553), c("GO:0044275","cellular carbohydrate catabolic process", 0.982,-1.222, 4.957, 5.049,-2.3175,0.764,0.557), c("GO:0048754","branching morphogenesis of a tube", 0.021, 6.962, 0.915, 3.372,-1.1401,0.840,0.565), c("GO:0048610","cellular process involved in reproduction", 0.190, 4.778, 5.835, 4.336,-1.2370,0.925,0.578), c("GO:0051235","maintenance of location", 0.032, 0.003,-7.101, 3.556,-1.1768,0.797,0.584), c("GO:0034654","nucleobase-containing compound biosynthetic process", 3.078,-2.654, 4.210, 5.545,-1.6684,0.775,0.593), c("GO:0010035","response to inorganic substance", 0.247,-5.532,-0.359, 4.449,-1.3927,0.933,0.602), c("GO:0016051","carbohydrate biosynthetic process", 2.083,-3.655, 4.903, 5.375,-1.0974,0.792,0.608), c("GO:0009791","post-embryonic development", 0.098, 7.474, 0.848, 4.048,-1.0187,0.829,0.624), c("GO:0051094","positive regulation of developmental process", 0.070, 6.464,-2.118, 3.901,-1.1401,0.748,0.635), c("GO:0009994","oocyte differentiation", 0.006, 6.741, 1.837, 2.823,-1.4546,0.812,0.641), c("GO:0046364","monosaccharide biosynthetic process", 0.334,-2.739, 5.480, 4.581,-2.3043,0.676,0.648), c("GO:0007444","imaginal disc development", 0.009, 7.187, 0.842, 2.991,-1.0128,0.839,0.651), c("GO:0051960","regulation of nervous system development", 0.044, 6.624,-1.787, 3.698,-1.2315,0.729,0.657), c("GO:0035315","hair cell differentiation", 0.001, 7.498, 1.142, 2.134,-1.1666,0.814,0.658), c("GO:0006119","oxidative phosphorylation", 0.910,-3.757,-1.529, 5.016,-1.0581,0.898,0.680), c("GO:0007398","ectoderm development", 0.003, 7.765, 0.609, 2.464,-1.1549,0.855,0.685)); one.data <- data.frame(revigo.data); names(one.data) <- revigo.names; one.data <- one.data [(one.data$plot_X != "null" & one.data$plot_Y != "null"), ]; one.data$plot_X <- as.numeric( as.character(one.data$plot_X) ); one.data$plot_Y <- as.numeric( as.character(one.data$plot_Y) ); one.data$plot_size <- as.numeric( as.character(one.data$plot_size) ); one.data$log10_p_value <- as.numeric( as.character(one.data$log10_p_value) ); one.data$frequency <- as.numeric( as.character(one.data$frequency) ); one.data$uniqueness <- as.numeric( as.character(one.data$uniqueness) ); one.data$dispensability <- as.numeric( as.character(one.data$dispensability) ); #head(one.data); # -------------------------------------------------------------------------- # Names of the axes, sizes of the numbers and letters, names of the columns, # etc. can be changed below p1 <- ggplot( data = one.data ); p1 <- p1 + geom_point( aes( plot_X, plot_Y, colour = log10_p_value, size = plot_size), alpha = I(0.6) ) + scale_area(); p1 <- p1 + scale_colour_gradientn( colours = c("blue", "green", "yellow", "red"), limits = c( min(one.data$log10_p_value), 0) ); p1 <- p1 + geom_point( aes(plot_X, plot_Y, size = plot_size), shape = 21, fill = "transparent", colour = I (alpha ("black", 0.6) )) + scale_area(); p1 <- p1 + scale_size( range=c(5, 30)) + theme_bw(); # + scale_fill_gradientn(colours = heat_hcl(7), limits = c(-300, 0) ); ex <- one.data [ one.data$dispensability < 0.15, ]; p1 <- p1 + geom_text( data = ex, aes(plot_X, plot_Y, label = description), colour = I(alpha("black", 0.85)), size = 3 ); p1 <- p1 + labs (y = "semantic space x", x = "semantic space y"); p1 <- p1 + opts(legend.key = theme_blank()) ; one.x_range = max(one.data$plot_X) - min(one.data$plot_X); one.y_range = max(one.data$plot_Y) - min(one.data$plot_Y); p1 <- p1 + xlim(min(one.data$plot_X)-one.x_range/10,max(one.data$plot_X)+one.x_range/10); p1 <- p1 + ylim(min(one.data$plot_Y)-one.y_range/10,max(one.data$plot_Y)+one.y_range/10); # -------------------------------------------------------------------------- # Output the plot to screen p1; # Uncomment the line below to also save the plot to a file. # The file type depends on the extension (default=pdf). # ggsave("C:/Users/path_to_your_file/revigo-plot.pdf");